<template>
    <div>
        <h1>绑定账号</h1>
        用户名：<input type="username" v-model="username">
        密码：<input type="password" v-model="password">
        <input type="button" value="绑定" @click="bind">
    </div>
</template>

<script>
export default {
    data(){
        return{
            username:'',
            password:'',
            uid:this.$route.query.uid,
        }
    },
    methods:{
        bind(){
            const data={
                'username':this.username,
                'password':this.password,
                'uid':this.uid,
            }
            this.axios.post('/weibo/',data).then(resp=>{
                console.log(resp.data)
                if(resp.data.code==200){
                    alert('绑定成功')
                }else{
                    alert('本地账号不存在')
                }
            }).catch(error=>{
                console.log(error.response)
            })
        }
    }
}
</script>

<style>

</style>